package point

type WifiXApPasswordPoint struct {
	index int
}

var wifixApPassword string

func NewWifiXApPasswordPoint() *WifiXApPasswordPoint { return &WifiXApPasswordPoint{} }

func (s *WifiXApPasswordPoint) Get() any {
	return wifixApPassword
}

func (m *WifiXApPasswordPoint) Set(val ...any) bool {
	if len(val) < 1 {
		return false
	}

	if passwd, ok := val[0].(string); ok {
		wifixApPassword = passwd
	}

	return true
}

func (m *WifiXApPasswordPoint) SetRoute(str string) PointInterface {
	m.index = int(str[len("wan")]) - '0'
	return m
}
